/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.diplomka.servicelayer.gamelogic.manager;

import cz.fi.muni.diplomka.common.enumeration.MovementType;
import cz.fi.muni.diplomka.common.enumeration.ResourceType;
import cz.muni.fi.diplomka.servicelayer.dto.IncomingResources;
import cz.muni.fi.diplomka.servicelayer.dto.ShopOffer;
import java.util.List;

/**
 * Interface for manipulating with Resources transfer between Players
 *
 * @author Jakub Kutil
 */
public interface MarketManager {

    /**
     * Creates Shop Offer
     *
     * @param shopOffer Shop Offer to create
     */
    public void createShopOffer(ShopOffer shopOffer);

    /**
     * Edits Shop Offer
     *
     * @param shopOffer Shop Offer to edit
     */
    public void editShopOffer(ShopOffer shopOffer);

    /**
     * Removes Shop Offer
     *
     * @param id Id of Shop Offer to remove
     */
    public void deleteShopOffer(Long id);

    /**
     * Gets Shop Offer by specified Id
     *
     * @param id Id of Shop Offer to find
     * @return found Shop Offer or empty one if not found
     */
    public ShopOffer getShopOfferById(Long id);

    /**
     * Gets all Shop Offers made by specified Player
     *
     * @param playerId Id of specified Player
     * @return list of all Shop Offers made by specified Player
     */
    public List<ShopOffer> getShopOffersOfPlayer(Long playerId);

    /**
     * Gets all Shop Offers made by other Players than specified Player
     *
     * @param playerId Id of specified Player
     * @return list of all Shop Offers made by other Players than specified
     * Player
     */
    public List<ShopOffer> getShopOffersNotOfPlayer(Long playerId);

    /**
     * Buys Shop Offer by specified Player
     *
     * @param shopOfferId Id of bought Shop Offer
     * @param buyerId Id of buying Player
     */
    public void buyShopOffer(Long shopOfferId, Long buyerId);

    /**
     * Send Resources from one City to another
     *
     * @param cityFrom City to send from
     * @param cityTo City to send to
     * @param resourceType type of sent Resource
     * @param count count of sent Resource
     * @param movementType type of Movement
     */
    public void sendResources(Long cityFrom, Long cityTo, ResourceType resourceType, int count, MovementType movementType);

    /**
     * Gets all Resources coming to specified City
     *
     * @param cityId Id of specified City
     * @return list of all incoming Resources
     */
    public List<IncomingResources> getIncomingResourcesOfCity(Long cityId);

    /**
     * Gets all Resources coming from specified City
     *
     * @param cityId Id of specified City
     * @return list of all outcoming Resources
     */
    public List<IncomingResources> getOutcomingResourcesOfCity(Long cityId);

    /**
     * Cancels Shop Offers
     *
     * @param id Id of Shop Offer to cancel
     */
    public void cancelShopOffer(Long id);

    /**
     * Gets list of all coming Resources
     *
     * @return list of all coming Resources
     */
    public List<IncomingResources> getAllIncomingResources();

    /**
     * Deletes Incoming Resources
     *
     * @param id Id of Incoming Resources to delete
     */
    public void deleteIncomingResources(Long id);
}
